package com.xiaomaoguai.di34;

/*
 * @Description :
 * @FileName: OperationTest.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年1月4日 下午1:54:02
 * @Version:1.0.0
 */
public class OperationTest {

	public static void main(String[] args) {
		double x = 15.0;
		double y = 5.0;
		test(BasicOpearation.class, x, y);
	}

	private static <T extends Enum<T> & Operation> void test(Class<T> opSet, double x, double y) {
		for (Operation op : opSet.getEnumConstants()) {
			System.out.println(op);
			System.out.printf("%f %s %f = %f%n", x, op, y, op.apply(x, y));
		}
	}
}
